<%-- 
    Document   : types
    Created on : Apr 29, 2012, 9:39:02 PM
    Author     : Jayson Kiong
--%>

<%@page import="Model.Types"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="Pragma" content="no-cache">
        <meta http-equiv="Cache-Control" content="no-cache">
        <meta http-equiv="Expires" content="Sat, 01 Dec 2001 00:00:00 GMT">
        <title>Types</title>
        <link rel = "stylesheet" type = "text/css" href = "quicklendstyle.css"/>
        <link type="text/css" href="css/ui-lightness/jquery-ui-1.8.19.custom.css" rel="stylesheet" />
        <script src="gen_validatorv4.js" type="text/javascript"></script>
	<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="js/jquery-ui-1.8.19.custom.min.js"></script>
        <script type="text/javascript" src="quicklendjs.js"></script>
	<script type="text/javascript">
		$(function(){

			// Accordion
			$("#accordion").accordion({ header: "h3" });

			// Tabs
			$('#tabs').tabs();

			// Dialog
			$('#dialog').dialog({
				autoOpen: false,
				width: 600,
				buttons: {
					"Ok": function() {
						$(this).dialog("close");
					},
					"Cancel": function() {
						$(this).dialog("close");
					}
				}
			});
				// Dialog Link
			$('#dialog_link').click(function(){
				$('#dialog').dialog('open');
				return false;
			});
				// Datepicker
			$('#datepicker').datepicker({
				inline: true
			});
				// Slider
			$('#slider').slider({
				range: true,
				values: [17, 67]
			});
				// Progressbar
			$("#progressbar").progressbar({
				value: 20
			});
				//hover states on the static widgets
			$('#dialog_link, ul#icons li').hover(
				function() { $(this).addClass('ui-state-hover'); },
				function() { $(this).removeClass('ui-state-hover'); }
			);
                            
                            
			});
                        
                     
	</script>
        
    </head>
    <body>
        <%ArrayList ar = (ArrayList)session.getAttribute("types");
          int arctr;
          Types type = new Types();
          int arsize = ar.size();  
        %>
        <div id="head" style="position:absolute;top:12px;left:25px; font-family:segoe ui;font-size:20px;color:#EBBD05;font-weight:600">
            Types
        </div>
        
        
                <div id="typeentryfieldhead" style="position:absolute; top:70px; left:30px; font-family:segoe ui; font-weight:600;font-size:14px">
                    Entry Field
                </div>
        <form id="addtypeform" action="/Quicklend/AddType" method="POST">
                <div id="typeentryfield" style="position:absolute; top:110px; left:30px; font-family:segoe ui;">
                    Name:&nbsp;&nbsp;&nbsp;&nbsp;<input name="name" type="text" style="width:200px;height:15px;font-family:segoe ui;"><div id='addtypeform_name_errorloc'></div></br>Type:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                <select name="type" style="width:135px" >
                                                <option value="Loan">Loan</option>
                                                <option value="Client">Client</option >
                                                <option value="Sub">Sub</option>
                                                </select>&nbsp;&nbsp;&nbsp;&nbsp;
                </div>

                <div id="typefunction" style="position:absolute; top:170px; left:500px; font-family: segoe ui;">
                    <input type="image" src="images/saveimage.png" name="savebtn"  size="13" style="position:absolute; left:0px"/></a>
                    <a href="#" class="precompcancelbtn" name="precompcancelbtn"  size="13" style="position:absolute; left:170px"/></a>

                </div>
        </form>
        
        <div id="tabs" style="position:absolute;width:850px;height:300px;top:280px;left:20px; border:none; font-size:11px">
		<ul>
                    <li><a href="#tabs-1">Loan Types</a></li>
                    <li><a href="#tabs-2">Client Types</a></li>
                    <li><a href="#tabs-3">Sub Types</a></li>
				
		</ul>
            <div id="tabs-1">
                <div id="typetable" style="position:absolute; top:50px; left:20px; font-family: segoe ui; font-size:11px;overflow: auto; width: auto; height:200px; padding:0px; margin: 0px; ">
                                <table border="1" cellspacing=0 cellpadding=2>
                                <COL WIDTH=300><COL WIDTH=250><COL WIDTH=250>
                                <tr>
                                    <th width=250 bgcolor="lightgrey">Name</th>
                                    <th width="100" bgcolor="lightgrey">Function</th>
                                </tr>
                                <%arctr=0;
                                  for(int x=0;x<arsize;x++){
                                  type=(Types)ar.get(arctr); 
                                  if(type.getStrType().equals("Loan")){%>
                                  <tr><td><%=type.getStrName()%></td><td><input type="button" name="delete" value="Delete" style="background-color:#ff0000;font-weight:bold;color:#ffffff;" onclick="deleteRecord(<%=type.getiID()%>)"></td><td style="display:none;"><input type="hidden" name="id" value="<%=type.getiID()%>"></td></tr>
                                  <%}%>   
                                <%arctr++;}%> 
                             </table>
                </div>
            </div>
            <div id="tabs-2">
                <div id="typetable" style="position:absolute; top:50px; left:20px; font-family: segoe ui; font-size:11px;overflow: auto; width: auto; height:200px; padding:0px; margin: 0px; ">
                                <table border="1" cellspacing=0 cellpadding=2>
                                <COL WIDTH=300><COL WIDTH=250><COL WIDTH=250>
                                <tr>                               
                                    <th width=250 bgcolor="lightgrey">Name</th>
                                    <th width=100 bgcolor="lightgrey">Function</th>
                                </tr>
                                <%arctr=0;
                                  for(int x=0;x<arsize;x++){
                                  type=(Types)ar.get(arctr); 
                                  if(type.getStrType().equals("Client")){%>
                                  <tr><td><%=type.getStrName()%></td><td><input type="button" name="delete" value="Delete" style="background-color:#ff0000;font-weight:bold;color:#ffffff;" onclick="deleteRecord(<%=type.getiID()%>)" ></td><td style="display:none;"><input type="hidden" name="id" value="<%=type.getiID()%>"></td></tr>
                                  <%}%>   
                                <%arctr++;}%> 
                             </table>
                </div>
            </div>
            <div id="tabs-3">
                <div id="typetable" style="position:absolute; top:50px; left:20px; font-family: segoe ui; font-size:11px;overflow: auto; width:auto; height: 200px; padding:0px; margin: 0px; ">
                                <table border="1" cellspacing=0 cellpadding=2>
                                <COL WIDTH=300><COL WIDTH=250><COL WIDTH=250>
                                <tr>                       
                                    <th width=250 bgcolor="lightgrey">Name</th>
                                    <th width=100 bgcolor="lightgrey">Function</th>
                                </tr>
                                <%arctr=0;
                                  for(int x=0;x<arsize;x++){
                                  type=(Types)ar.get(arctr); 
                                  if(type.getStrType().equals("Sub")){%>
                                  <tr><td><%=type.getStrName()%></td><td><input type="button" name="delete" value="Delete" style="background-color:#ff0000;font-weight:bold;color:#ffffff;" onclick="deleteRecord(<%=type.getiID()%>)"></td><td style="display:none;"><input type="hidden" name="typeid" value="<%=type.getiID()%>"></td></tr>
                                  <%}%>   
                                <%arctr++;}%> 
                                
                             </table>
                </div>
            </div>
        </div>

                

                <div id="typebutton" style="position:absolute; top:550px; left:325px; font-family: segoe ui;">  
                    <!--<a href="#" class="deletebtn" name="deletebtn"  size="13" style="position:absolute; left:170px"/><img src="images/deletebtn.png" alt=""></img></a>!-->
                    <form action="TypeServlet" method="POST">
                    <input type="image" src="images/refreshbtnimage.png" name="savebtn"  size="13" style="position:absolute; left:340px"/></a>
                    </form>
                </div>
               
            
             
             
    </body>
    <script type="text/javascript">
         var frmvalidator  = new Validator("addtypeform");
        
         frmvalidator.addValidation("name","req","Please enter the Loan Name");
         frmvalidator.EnableOnPageErrorDisplay();
         frmvalidator.EnableMsgsTogether();
    </script>
</html>
